home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / science / ktext094.sit / KTEXT User's Guide next >
Text File  |  1991-05-06  |  85KB  |  2,002 lines

  1.                           KTEXT User's Guide
  2.  
  3.                            Evan L. Antworth
  4.                    Summer Institute of Linguistics
  5.                        evan@txsil.lonestar.org
  6.  
  7.                              May 6, 1991
  8.                          KTEXT version 0.9.4
  9.  
  10. 1  Overview of KTEXT
  11.    1.1  What does KTEXT do?
  12.    1.2  Placing KTEXT in its context
  13.    1.3  Technical specifications
  14.    1.4  Program status
  15. 2  Example of using KTEXT to process a text
  16. 3  Running KTEXT
  17. 4  KTEXT's functional structure
  18. 5  The text data file
  19. 6  The main control file
  20. 7  The TXTIN control file
  21.    7.1  Text orthography changes
  22.    7.2  Words or format markers?
  23.    7.3  Selecting fields
  24.    7.4  Special output characters
  25.    7.5  Controlling capitalization
  26.    7.6  A sample text input control file
  27. 8  The output data file
  28. 9  CED: an editor for failures and ambiguities
  29.    9.1  Overview of CED
  30.    9.2  Starting the CED editor
  31.    9.3  Editing for text glossing
  32.    9.4  The editing process
  33.    9.5  Command summary
  34. Notes
  35. References
  36.  
  37.  
  38. 1  Overview of KTEXT
  39.  
  40. This section briefly describes what KTEXT does, places KTEXT in its
  41. computational context, lists technical specifications of the program,
  42. and gives information on use and support of the program.
  43.  
  44. 1.1  What does KTEXT do?
  45.  
  46. KTEXT is a text processing program that uses the PC-KIMMO parser (see
  47. below about PC-KIMMO). KTEXT reads a text from a disk file, parses
  48. each word, and writes the results to a new disk file. This new file is
  49. in the form of a structured text file where each word of the original
  50. text is represented as a database record composed of several fields.
  51. Each word record contains a field for the original word, a field for
  52. the underlying or lexical form of the word, and a field for the gloss
  53. string. For example, if the text in the input file contains the word
  54. hoping (to use an English example), KTEXT's output file will have a
  55. record of this format:
  56.  
  57. \a  V(hope)+PROG
  58. \d  hope+ing
  59. \w  hoping
  60.  
  61. This record consists of three fields, each tagged with a backslash
  62. code.[1] The first field, tagged with \a for analysis, contains the
  63. gloss string for the word. The second field, tagged with \d for
  64. (morpheme) decomposition, contains the underlying or lexical form of
  65. the word. And the third field, tagged with \w for word, contains the
  66. original word. The word spies demonstrates how KTEXT handles multiple
  67. parses:
  68.  
  69. \a  %2%N(spy)+PLURAL%V(spy)+3SG%
  70. \d  %2%spy+s%spy+s%
  71. \w  spies
  72.  
  73. Percent signs (or some other designated character) separate the
  74. multiple results in the \a and \d fields, with a number indicating how
  75. many results were found.
  76.  
  77. A word record also saves any capitalization or punctuation associated
  78. with the original word. For example, if a sentence begins "Obviously,
  79. this hypothesis.", KTEXT will output the first word like this:
  80.  
  81. \a  ADJ(obvious)+ADVR
  82. \d  obvious+ly
  83. \w  obviously
  84. \c  1
  85. \n  ,
  86.  
  87. The \w field contains the original word without capitalization or the
  88. following comma. The \c field contains the number 1 which indicates
  89. that the first letter of the original word is upper case. The \n field
  90. contains the comma that follows the original word. The purpose of
  91. retaining the capitalization and punctuation of the original text is,
  92. of course, to enable one to recover the original text from KTEXT's
  93. output file.
  94.  
  95. The output of KTEXT is not intended to be an end in itself. While
  96. there may be some usefulness in directly examining the data structures
  97. produced by KTEXT, the intention is to use KTEXT's output as the basis
  98. of further data processing. A number of applications could use the
  99. kind of morphologically parsed text that KTEXT produces, including
  100. syntactic parsers, concordance programs, and machine translation
  101. programs.
  102.  
  103. 1.2  Placing KTEXT in its context
  104.  
  105. KTEXT can only be understood by describing two other programs:
  106. PC-KIMMO and AMPLE. First, we will take a look at PC-KIMMO. KTEXT is
  107. intended to be used with PC-KIMMO (though it is a stand-alone
  108. program). PC-KIMMO is a program for doing computational phonology and
  109. morphology. It is typically used to build morphological parsers for
  110. natural language processing systems. PC-KIMMO is described in the book
  111. "PC-KIMMO: a two-level processor for morphological analysis" by Evan
  112. L. Antworth, published by the Summer Institute of Linguistics (1990).
  113. The PC- KIMMO software is available for MS-DOS (IBM PCs and
  114. compatibles), Macintosh, and UNIX. The book (including software) is
  115. available for $23.00 (plus postage) from:
  116.  
  117.     International Academic Bookstore
  118.     7500 W. Camp Wisdom Road
  119.     Dallas TX, 75236
  120.     U.S.A.
  121.  
  122.     phone  214/709-2404
  123.     fax    214/709-2433
  124.  
  125. The KTEXT program which this document describes will be of very little
  126. use to you without the PC-KIMMO program and book. The remainder of
  127. this document assumes that you are familiar with PC-KIMMO. 
  128.  
  129. PC-KIMMO was deliberately designed to be reuseable. The core of 
  130. PC-KIMMO is a library of functions such as load rules, load lexicon, 
  131. generate, and recognize. The PC-KIMMO program supplies on the release 
  132. diskette is just a user shell built around these basic functions. This 
  133. shell provides an environment for developing and testing sets of rules 
  134. and lexicons. Since the shell is a development environment, it has very
  135. little built-in data processing capability. But because PC-KIMMO is
  136. modular and portable, you can write your own data processing program
  137. that uses PC-KIMMO's function library. KTEXT is an example of how to
  138. use PC- KIMMO to create a new natural language processing program.
  139. KTEXT is a text processing program that uses PC-KIMMO to do
  140. morphological parsing.
  141.  
  142. KTEXT is also closely related to a program called AMPLE (Weber et al.
  143. 1988), which is also a morphological parser designed to process text.
  144. KTEXT was created by replacing AMPLE's parsing engine with the
  145. PC-KIMMO parser. Thus KTEXT has the same text-handling mechanisms as
  146. AMPLE and produces output similar or even identical to AMPLE. The
  147. advantages of this design are (1) we were able to develop KTEXT very
  148. quickly and easily since it involved very little new code, and (2)
  149. existing programs that use AMPLE's output format can also use KTEXT's
  150. output. The disadvantage of basing KTEXT on AMPLE is that the format
  151. of the output file is perhaps not consistent with terminology already
  152. established for PC-KIMMO.
  153.  
  154. 1.3  Technical specifications
  155.  
  156. KTEXT runs under three operating systems: 
  157.  
  158.     MS-DOS (IBM PC compatibles),
  159.     UNIX System V (SCO UNIX V/386 and A/UX) and 4.2 BSD UNIX, and
  160.     Apple Macintosh. 
  161.  
  162. KTEXT does not require any graphics capability. It handles eight- bit
  163. characters (such as the IBM extended character set). It requires a
  164. minimal amount of memory (at least 256KB on an IBM PC compatible), but
  165. more memory is needed to load large lexicons. The Macintosh version
  166. has the same user interface as the DOS and UNIX versions, namely a
  167. batch-processing, command-line interface. In other words, it does not
  168. use the Macintosh mouse, menus, and windows interface.
  169.  
  170. The program is written entirely in C and is very portable. The
  171. Macintosh version was compiled with the Lightspeed Think C compiler.
  172.  
  173. 1.4  Program status
  174.  
  175. KTEXT was developed by Steven McConnel and Evan Antworth of the Summer
  176. Institute of Linguistics. KTEXT version 0.9 is a beta test version.
  177. Its features are subject to change. Several qualifications apply to
  178. its use and support:
  179.  
  180. (1)  This software, source code and executable program, is copyrighted
  181. by the Summer Institute of Linguistics. You may use this software at
  182. no cost for whatever purpose you see fit. You are granted the right to
  183. distribute this software to others, provided that all files are
  184. included in unmodified form and that you charge no fee (except cost of
  185. media). This software is intended for academic use only, and may not
  186. be distributed or used for commercial profit without express
  187. permission of the Summer Institute of Linguistics.
  188.  
  189. (2)  This software represents work in progress and bears no warranty,
  190. either expressed or implied, of its fitness for any particular
  191. purpose.
  192.  
  193. (3)  In releasing this software , the Summer Institute of Linguistics
  194. is making no commitment to maintain it. It is, however, committed to
  195. forwarding user feedback to the software's authors who may or may not
  196. choose to develop the software further.
  197.  
  198. Bug reports, wish lists, requests for support, and positive feedback
  199. should be directed to Evan Antworth at this address:
  200.  
  201.     Evan Antworth
  202.     Academic Computing Department
  203.     Summer Institute of Linguistics
  204.     7500 W. Camp Wisdom Road
  205.     Dallas, TX  75236
  206.  
  207.     phone: 214/709-2418
  208.     e-mail: evan@txsil.lonestar.org
  209.  
  210. 2  Example of using KTEXT to process a text
  211.  
  212. Typically, the steps involved in using KTEXT are:
  213.  
  214. (1)  Collect a corpus of language data suitable for phonological and
  215. morphological analysis (typically paradigms of words).
  216.  
  217. (2)  Do phonological and morphological analysis on the data.
  218.  
  219. (3)  Use the PC-KIMMO shell to develop a rules file and a lexicon file
  220. that encode your phonological and morphological analyses and to test
  221. them against your corpus of data.
  222.  
  223. (4)  Select a text and keyboard it.
  224.  
  225. (5)  Set up the control files required by KTEXT.
  226.  
  227. (6)  Using the rules and lexicon you developed, process the text with
  228. KTEXT.
  229.  
  230. (7)  Edit KTEXT's output file to remove multiple parses.
  231.  
  232. (8)  Use the edited file as input to some other program.
  233.  
  234. To demonstrate how to use KTEXT to process a text, we will use a
  235. folktale text taken from Leonard Bloomfield's (1917) collection of
  236. Tagalog[2] texts. The first step in the project was to analyze the
  237. phonology and morphology of Tagalog and develop the rules and lexicon
  238. files for PC-KIMMO. The phonology and morphology of Tagalog are rather
  239. complex. Verbs in particular exhibit a considerable amount of both
  240. derivational and inflectional morphology. One of the more exotic
  241. features of Tagalog morphology is its pervasive use of infixes and
  242. reduplication. For example, the root lçkad is made into a verb by
  243. placing the infix um after the first consonant of the root to produce
  244. lumçkad. The durative aspect of this verb is signaled by reduplicating
  245. the first consonant and vowel of the root to produce lçlçkad. The two
  246. processes can be combined to produce lumçlçkad. In addition to this
  247. morphological complexity, at least a dozen rules are required to
  248. account for various morphophonemic processes, including coalescence,
  249. stress shift, and syncope. For example, the underlying form bilô+in is
  250. realized as the surface form bilhôn. In the two-level model, these
  251. forms are related like this:
  252.  
  253. UF:  b i l ô 0 + i n
  254. SF:  b i l 0 h 0 ô n
  255.  
  256. Rules are required to account for the syncopation of ô, the insertion
  257. of h, and the shift of stress from the last syllable of the root to
  258. the suffix.
  259.  
  260. After the rules and lexicon had been written and tested using
  261. PC-KIMMO, the next step was to keyboard the chosen text. The first
  262. paragraph of the text is shown in figure 1.
  263.  
  264.                  Figure 1  Fragment of a Tagalog text
  265.  
  266. \ti Aû ulÿl na uûgÿ at aû mar£noû na pagÿû.
  267.  
  268. \p
  269. \s MÆnsan aû pagÿû hçbaû nalôlÆgo sa Ælog, ay nakêkÆta syê
  270. naû isa_û p£no_û-sçgiû na lum¥l£taû at tinçtaûêy naû çgos.
  271. \s HinÆla niya sa pasÆgan, dçtapwat hindÆ nya madalê sa l£paq.
  272. \s Dçhil dÆto tinçwag nya aû kaybÆgan niya_û uûgÿq at iniyçlay
  273. nyê aû kap£tol naû p£no_û-sçgiû kuû itçtanim nyê aû kanyê_û
  274. kapartÅ.
  275. \s Tumaûÿq aû uûgÿq at hinçte nilê sa gitnêq mulç sa magkçbila_û
  276. d£lo aû p£no naû sçgiû.
  277. \s Inaûkôn naû uûgÿ aû kap£tol na mçy maûa dçhon, dçhil sa
  278. panukçlê nya na iyÿn ay t¥t£bo na mab£ti kçy sa kap£tol na wala_û
  279. dçhon.
  280.  
  281. The text was keyboarded using a very simple system of document markup
  282. that tags parts of the document with backslash codes. The \ti tag
  283. indicates the title of the story, the \p tag indicates the beginning
  284. of a paragraph, and the \s tag indicates the beginning of a sentence.
  285. A few small adjustments to the original transcription were made. For
  286. instance, where Bloomfield wrote enclitics separate from the preceding
  287. word, they have been joined with the underline character: isa_ng.
  288.  
  289. The next step was to process the keyboarded text with KTEXT. A
  290. fragment of the resulting output file is shown in figure 2.
  291.  
  292.                       Figure 2  Output of KTEXT
  293.  
  294.                       \a < DET S >
  295.                       \d aû
  296.                       \w \\ti
  297.                       \c 1
  298.  
  299.                       \a < AJ foolish >
  300.                       \d ulÿl
  301.                       \w ulÿl
  302.  
  303.                       \a %2%< PRT LKR >%< PRT ENC >%
  304.                       \d %2%na%nê%
  305.                       \w na
  306.  
  307.                       \a < N1 monkey >
  308.                       \d uûgÿq
  309.                       \w uûgÿ
  310.  
  311.                       \a < CNJ and >
  312.                       \d at
  313.                       \w at
  314.  
  315.                       \a < DET S >
  316.                       \d aû
  317.                       \w aû
  318.  
  319.                       \a AJR < N2 wisdom >
  320.                       \d ma-d£noû
  321.                       \w mar£noû
  322.  
  323.                       \a %2%< PRT LKR >%< PRT ENC >%
  324.                       \d %2%na%nê%
  325.                       \w na
  326.  
  327.                       \a < N1 turtle >
  328.                       \d pagÿû
  329.                       \w pagÿû
  330.                       \n .\n\n
  331.  
  332. This is as far as KTEXT takes us. What you do with KTEXT's output is
  333. limited only by your imagination and ingenuity. One obvious way to
  334. continue is to reassemble the text in interlinear format. That is, we
  335. could write a program that would take the data structures shown in
  336. figure 2 and create a new file where the text is stored in interlinear
  337. format. The resulting interlinear text is shown in figure 3. An
  338. interlinear text editor like IT[3] could then be used to add more lines
  339. of annotations to the text.
  340.  
  341.         Figure 3  A Tagalog example of interlinear text format
  342.  
  343.         Ang ulÿl    na  unggÿ  at  ang mar£nong   na  pagÿng.
  344.         ang ulÿl    na  unggoq at  ang ma- d£nong na  pagÿng
  345.         S   foolish LKR monkey and S   AJR-wisdom LKR turtle
  346.  
  347. Interlinear translation is a time-honored format for presenting
  348. analyzed vernacular texts. An interlinear text consists of a baseline
  349. text and one or more lines of annotations that are vertically aligned
  350. with the baseline. In the text shown in figure 3, the first line is
  351. the baseline text. The second line provides the lexical form of each
  352. original word, including morpheme breaks. The third line gives the
  353. gloss of each word or morpheme. Grammatical morphemes are glossed with
  354. abbreviations in all capital letters and lexical morphemes are glossed
  355. with equivalent English words. For instance, the word mar£nong in the
  356. first line is written as two morphemes in the second line: ma-d£nong
  357. (notice the phonological alternation between d and r). The third line
  358. gives its gloss, AJR-wisdom, where AJR stands for an adjectivizer
  359. prefix that changes the noun stem d£nong 'wisdom' into an adjective
  360. meaning 'wise'.
  361.  
  362. Another way to proceed would be to take the output of KTEXT as shown
  363. in figure 2 and format it directly for printing. In other words, there
  364. would be no disk file of interlinear text corresponding to figure 3;
  365. rather, the interlinear text is created on the fly as it is prepared
  366. for printing. Fortunately, the software required to print interlinear
  367. text is now available. As a complement to the IT program, a system for
  368. formatting interlinear text for typesetting has recently been
  369. developed (see Kew and McConnel, 1991). Called ITF, for Interlinear
  370. Text Formatter,[4] it is a set of TEX[5] macros that can format an
  371. arbitrary number of aligning annotations with up to two freeform
  372. (nonaligning) annotations. While ITF is primarily intended to format
  373. the data files produced by IT (similar to the interlinear text shown
  374. in figure 3), an auxiliary program provided with ITF accepts the
  375. output of the KTEXT program. The final printed result of the
  376. formatting process is shown in figure 4.[6] It should be noted that this
  377. is just one of many formats that ITF can produce. Because ITF is built
  378. on a full-featured typesetting system, virtually all aspects of the
  379. formatting detail can be customized, including half a dozen different
  380. schemes for laying out the freeform annotations relative to the
  381. interlinear text.
  382.  
  383. 3  Running KTEXT
  384.  
  385. This section describes KTEXT's user interface and the input files it
  386. uses.
  387.  
  388. KTEXT is a batch-processing program. This means that the program takes
  389. as input a text from a disk file and returns as output the processed
  390. text in a new disk file. KTEXT is run from the command line by giving
  391. it the information it needs (file names and other options). It does
  392. not have an interactive interface. The user controls KTEXT's operation
  393. by means of special files that contain all the information KTEXT needs
  394. to process the input text. These files are called control files. Here
  395. is an example of running KTEXT on an English text (an excerpt from
  396. Lewis Carroll's Alice's Adventures in Wonderland). At the operating
  397. system prompt, type "ktext" plus various command line options:
  398.  
  399. C:\>ktext -w -x english.ctl -i alice.txt -o alice.ana -l alice.log
  400.  
  401. The following will appear on the screen:
  402.  
  403. KTEXT TWO-LEVEL PROCESSOR
  404. Version 0.9.4 (11 March 1991), Copyright 1991 SIL
  405.  
  406.       Using the following as word-formation characters:
  407.       ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-'
  408.  
  409. Rules being loaded from english.rul
  410. Lexicon being loaded from english.lex
  411. ..................................................................
  412. ..................................................................
  413. ............
  414.  
  415. Each dot represents one word successfully processed. When the program
  416. is done, it will return you to the operating system prompt.
  417.  
  418. To see a list of the command line options, type "ktext -h". You will
  419. see a display similar to this:
  420.  
  421. -c <char>     make <char> the comment character (default is ;)
  422. -t            set tracing on (default is off)
  423. -w            include \w field in output file(default is no \w field)
  424. -x <ctlfile>  specify the control file name (default is ktext.ctl)
  425. -i <infile>   specify the input data file name
  426. -o <outfile>  specify the output file name
  427. -l <logfile>  specify the log file name (default is none)
  428.  
  429. The command line options (-w, -x, and so on) are all lower case
  430. letters. Here is a detailed description of each command line option.
  431.  
  432. -c  The -c option takes an argument that sets the comment character
  433. used in the PC-KIMMO rules and lexicon files. It has no effect on any
  434. other files used by KTEXT except these two. If the -c option is not
  435. used, the default PC-KIMMO comment character is used, namely semicolon
  436. (;).
  437.  
  438. -t  The -t option turns the PC-KIMMO tracing mechanism on. This
  439. displays on the screen everything the parser is doing when it
  440. processes a word. Tracing is used for debugging the rules and lexicon,
  441. and is better used with the PC-KIMMO shell program.
  442.  
  443. -w  The -w option causes the \w field to be included in each word
  444. record of the output file. The \w field contains the original word
  445. from the text. If you don't include the -w option, the word records of
  446. the output file will contain only the \a (analysis) and \d (morpheme
  447. decomposition) fields.
  448.  
  449. -x  The -x option takes an optional argument that specifies the name
  450. of the main KTEXT control file. This main control file contains the
  451. name of the TXTIN control file and the names of the rules and lexicon
  452. files. It can also specify consistent changes to be made to the output
  453. fields. The -x option accepts a default file name extension of CTL;
  454. for example if you use "- x english" KTEXT will try to load the file
  455. "english.ctl". If the -x option is not used, KTEXT will try to load a
  456. control file with the default file name KTEXT.CTL.
  457.  
  458. -i  The -i option takes an obligatory argument that specifies the name
  459. of the input file containing the text that KTEXT will process. If the
  460. -i option is not used, KTEXT will prompt you to enter the name of the
  461. input file.
  462.  
  463. -o  The -o option takes an obligatory argument that specifies the name
  464. of the output file that KTEXT creates. If the -o option is not used,
  465. KTEXT will prompt you to enter the name of the output file. If a file
  466. with the same name already exists, KTEXT will will ask for
  467. confirmation that you want to overwrite it.
  468.  
  469. -l  The -l option takes an obligatory argument that specifies the name
  470. of a log file. The log file will contain any analysis failures or
  471. other anomalous behavior during processing of the input text.
  472.  
  473. In all instances where file names are supplied to KTEXT, an optional
  474. directory path can be included; for example, -i c:\texts\alice.txt.
  475.  
  476. 4  KTEXT's functional structure
  477.  
  478. KTEXT has two main functional modules: the TXTIN module and the
  479. ANALYSIS module. The diagram in figure 5 shows the flow of data
  480. through these modules. The input text is fed into the TXTIN module
  481. which outputs the text as a stream of normalized words with
  482. capitalization and punctuation stripped out and saved. The TXTIN
  483. module also uses a control file that specifies orthographic changes.
  484. Each word is then passed to the ANALYSIS module where it is parsed and
  485. output as a database record. The ANALYSIS module also uses the
  486. PC-KIMMO rules and lexicon files.
  487.  
  488.                Figure 5  Functional structure of KTEXT
  489.  
  490.                            input text
  491.                                 |
  492.                                 |
  493.                    +------------------------+
  494.                    |            |           |
  495.                    |    +--------------+    |
  496.   text input       |    |              |    |
  497.   control file---->|    |    TXTIN     |    |--------+
  498.                    |    |              |    |        |
  499.                    |    +--------------+    |        |
  500.                    |            |           |   punctuation
  501.                    |          words         |   white space
  502.                    |            |           |   capitalization
  503.                    |    +--------------+    |   format marking
  504.   rules and        |    |              |    |
  505.   lexicon files--->|    |   ANALYSIS   |    |
  506.                    |    |              |    |
  507.                    |    +--------------+    |
  508.                    |            |           |
  509.                    +------------------------+
  510.                                 |
  511.                                 |
  512.                           parsed output
  513.  
  514. KTEXT uses five input files and produces one output file (plus an
  515. optional log file). These five input files are:
  516.  
  517.     the text data file,
  518.     the main control file,
  519.     the TXTIN control file,
  520.     the PC-KIMMO rules file, and
  521.     the PC-KIMMO lexicon file.
  522.  
  523. The PC-KIMMO rules and lexicon files are described in the PC-KIMMO
  524. book (Antworth 1990) and will not be discussed further in this
  525. document. The other input files and the output data file are described
  526. in the following sections.
  527.  
  528. 5  The text data file
  529.  
  530. The text data file contains the text that KTEXT will process. It must
  531. be a plain text file, not a file formatted by a word processor. If you
  532. use a word processor such as Microsoft Word to create your text, you
  533. must save it as plain text with no formatting. KTEXT preserves all the
  534. "white space" used in the text file. That is, it saves in its output
  535. file the location of all line breaks, blank lines, tabs, spaces, and
  536. other nonalphabetic characters. This enables you to recover from the
  537. output file the precise format and page layout of the original text.
  538.  
  539. While KTEXT will accept text with no formatting information other than
  540. white space characters, it will also handle text that contains special
  541. format markers. These format markers can indicate parts of the text
  542. such as sentences, paragraphs, sections, section headings, and titles.
  543. The use of special format markers is called descriptive markup. KTEXT
  544. (because it is based on AMPLE) works best with a system of descriptive
  545. markup called "standard format" that is used by the Summer Institute
  546. of Linguistics. SIL standard format marks the beginning of each text
  547. unit with a format marker. There is no explicit indication of the end
  548. of a unit. A format marker is composed of a special character (a
  549. backslash by default) followed by a code of one or more letter. For
  550. example, \ti for title, \ch for chapter, \p for paragraph, \s for
  551. sentence, and so on. KTEXT does not "know" any particular format
  552. markers. You can use whatever markers you like, as long as you declare
  553. them in the TXTIN control file. For more on format markers, see
  554. section 7.2.2 below.
  555.  
  556. One of the best know systems of descriptive markup is SGML (Standard
  557. Generalized Markup Language). One very significant difference between
  558. SGML and SIL standard format is that SGML uses markers in pairs, one
  559. at the beginning of a text unit and a matching one at the end. This
  560. should not pose a problem for KTEXT, since KTEXT just preserves all
  561. format markers wherever they occur. Another difference is that SGML
  562. flags format markers with angle brackets, for instance <paragraph>.
  563. KTEXT can recognize SGML markers by changing the format marker flag
  564. character from backslash to left angled bracket (see section 7.2.2
  565. below). Recognizing the end of the SGML format marker is a bit of a
  566. problem. While SGML uses a matching right angled bracket to indicate
  567. the end of the marker, SIL standard format simply uses a space to
  568. delineate the format marker from the following text. This means that
  569. for KTEXT to find the end of an SGML tag, you must leave at least one
  570. space after it.
  571.  
  572. 6  The main control file
  573.  
  574. The main control file controls various aspects of KTEXT's operation.
  575. It is structured as a standard format database, composed of various
  576. fields marked by backslash codes. Figure 6 shows the fields available
  577. in the main control file:
  578.  
  579.                Figure 6  Main control file field codes
  580.  
  581.                Code         Description
  582.                ---------    -----------------------
  583.                \textin      name of text control file
  584.                \rules       name of PC-KIMMO rules file
  585.                \lexicon     name of PC-KIMMO lexicon file
  586.                \ach         change in \a field
  587.                \dch         change in \d field
  588.                \scl         string class definition
  589.  
  590. The use of the first three fields listed above is straightforward. The
  591. \textin field specifies the name of the text control file described
  592. below in section 7. The \rules and \lexicon fields specify the names
  593. of the PC-KIMMO data files. For example, a main control file for
  594. Tagalog may contain these lines:
  595.  
  596. \textin  tagtxtin.ctl
  597. \rules   tag.rul
  598. \lexicon tag.lex
  599.  
  600. The next two fields, \ach and \dch, require more comment. These fields
  601. allow you to make consistent changes in the contents of the \a and \d
  602. fields before they are written to the output file. It works like this:
  603. the ANALYSIS module processes an input word from the text and returns
  604. its gloss and lexical form in \a and \d fields. KTEXT then applies any
  605. changes that have been specified in \ach and \dch fields and then
  606. writes the results to the output file. For example, the Tagalog main
  607. control file may contain these lines:
  608.  
  609. \dch "I-" "in-"
  610. \dch "U-" "um-"
  611.  
  612. The parser returns the lexical forms I- and U-, which is how they are
  613. found in the PC-KIMMO Tagalog lexicon (these are essentially special
  614. symbols represented infixes). The \dch fields change these forms into
  615. in- and um-, which is their typical phonological shape. The changes
  616. can also be restricted to apply only in certain environments. The \ach
  617. and \dch fields work identically to the \ch fields used in the text
  618. control file, described in detail in section 7.1.
  619.  
  620. The last field in figure 6 above is the \scl field, which is a string
  621. class definition field. It allows you to define a special symbol to
  622. stand for a set of characters; for instance, this string class field
  623. defines the symbol Vowel to stand for the set of vowels:
  624.  
  625. \scl Vowel a e i o u
  626.  
  627. The symbol Vowel can then be used in the environments of \ach and \dch
  628. fields. String class definitions are described in detail in section
  629. 7.1.4.
  630.  
  631. When KTEXT reads the main control file, it ignores any lines beginning
  632. with field codes other than those listed in figure 6. For example, a
  633. line beginning \co would be ignored. Such lines are treated as
  634. comments. Comments in the control file can also be indicated with the
  635. comment character, which by default is semicolon. This is the only way
  636. to place comments on the same line as a field. The comment character
  637. can be changed with the command line option -c when running KTEXT (see
  638. section 3). The main control file must use the same comment character
  639. as the rules and lexicon files.
  640.  
  641. The following shows a sample main control file.
  642.  
  643. \id tag.ctl - KTEXT main control file for Tagalog, 7-Mar-91
  644.  
  645. ; select the various other files
  646. \textin  tagtxtin.ctl
  647. \rules   tag.rul
  648. \lexicon tag.lex
  649.  
  650. ; fix up some underlying forms
  651. \dch "I-" "in-"
  652. \dch "U-" "um-"
  653.  
  654. 7  The TXTIN control file[7]
  655.  
  656.   7.1 Text orthography changes
  657.       7.1.1 Basic changes
  658.       7.1.2 Environmentally constrained changes
  659.       7.1.3 Where orthography changes apply
  660.       7.1.4 A sample orthography change table
  661.       7.1.5 Orthography change (\ch)
  662.       7.1.6 String class definition (\scl)
  663.   7.2 Words or format markers?
  664.       7.2.1 Word formation characters (\wfc)
  665.       7.2.2 Primary format marker character (\format)
  666.       7.2.3 Secondary format marker character (\barchar)
  667.       7.2.4 Single character bar codes (\barcodes)
  668.   7.3 Selecting fields
  669.       7.3.1 Fields to exclude (\excl)
  670.       7.3.2 Fields to include (\incl)
  671.   7.4 Special output characters
  672.       7.4.1 Ambiguity marker (\ambig)
  673.       7.4.2 Morpheme decomposition separator (\dsc)
  674.   7.5 Controlling capitalization
  675.   7.6 A sample text input control file
  676.  
  677. The TXTIN module applies to a text, splitting off the punctuation,
  678. format marking, white space (space, tab, carriage return), and
  679. capitalization information. It passes just the words of the text on to
  680. the ANALYSIS module, in a normalized, lower case form after making any
  681. user-specified orthographic changes. The TXTIN module requires three
  682. types of control information.
  683.  
  684. (1)  To identify words, TXTIN must know what letters make up words. It
  685. assumes that the alphabetic characters (a to z, upper and lower case)
  686. are used to make words; these are called the standard word formation
  687. characters. In addition to these there may be characters like tilde
  688. (~) and apostrophe (') in words like canon (Spanish), don't (English),
  689. etc. These are called nonstandard word formation characters.
  690.  
  691. (2)  It is desirable to apply KTEXT directly to texts in their
  692. practical orthographies, but to maintain the files the parser needs in
  693. a more linguistically-appropriate orthography. For example, Latin x
  694. can be converted to ks; Quechua long vowels, represented practically
  695. by doubling the vowel, can be converted to a single vowel followed by
  696. a colon (i.e., aa is converted to a:); and Campa nasals occurring
  697. before a noncontinuant can be represented as the morphophoneme N,
  698. unspecified for point of articulation (i.e., mp is converted to Np).
  699. This kind of change is made possible by the text input orthography
  700. changes, the rules defined for changing the orthography.
  701.  
  702. (3)  KTEXT incorporates rather specific ideas about how formatting
  703. information is given in texts. Some details of how formatting marks
  704. are separated from the words in the text are provided by the special
  705. formatting information. The text input control file influences how
  706. KTEXT reads the input text files, and, to some degree, the format of
  707. the output analysis files. Like the other input control files, it is
  708. structured as a standard format database file. Figure 7 shows the
  709. fields available in the text control file:
  710.  
  711.             Figure 7  Text input control file field codes
  712.  
  713.             Code         Description
  714.             ---------    -----------------------
  715.             \ambig       analysis output ambiguity marker
  716.             \barchar     secondary format marker
  717.             \barcodes    single character bar codes
  718.             \ch          orthography change
  719.             \dsc         morpheme decomposition separator
  720.             \excl        fields to exclude
  721.             \format      primary format marker
  722.             \incl        fields to include
  723.             \luwfc       lower-upper word formation characters
  724.             \noincap     disable word-internal capitalization
  725.             \scl         string class definition
  726.             \wfc         word formation characters
  727.  
  728. When KTEXT reads the text input control file, it ignores any lines
  729. beginning with field codes other than those listed in figure 7. For
  730. example, a line beginning \co would be ignored. Such lines are treated
  731. as comments. Comments in the control file can also be indicated with
  732. the comment character, which by default is semicolon. This is the only
  733. way to place comments on the same line as a field. The comment
  734. character can be changed with the command line option -c when running
  735. KTEXT (see section 3). The main control file must use the same comment
  736. character as the rules and lexicon files.
  737.  
  738. 7.1 Text orthography changes
  739.  
  740. 7.1.1 Basic changes
  741.  
  742. To substitute one string of characters for another, these must be made
  743. known to the program in a change. (The technical term for this sort of
  744. change is a production, but we will simply call them changes.)  In the
  745. simplest case, a change is given in three parts: (1) the field code
  746. \ch must be given at the extreme left margin to indicate that this
  747. line contains a change; (2) the match string is the string for which
  748. KTEXT must search; and (3) the substitution string is the replacement
  749. for the match string, wherever it is found.
  750.  
  751. The beginning and end of the match and substitution strings must be
  752. marked. The first printing character following \ch (with at least one
  753. space or tab between) is used as the delimiter for that line. The
  754. match string is taken as whatever lies between the first and second
  755. occurrences of the delimiter on the line and the substitution string
  756. is whatever lies between the third and fourth occurrences. For
  757. example, the following lines indicate the change of hi to bye, where
  758. the delimiters are the double quote mark ("), the single quote mark
  759. ('), the period (.), and the at sign (@).
  760.  
  761. \ch "hi" "bye"
  762. \ch 'hi' 'bye'
  763. \ch .hi. .bye.
  764. \ch @hi@ @bye@
  765.  
  766. Throughout this document, we use the double quote mark as the
  767. delimiter unless there is some reason to do otherwise.
  768.  
  769. Change tables follow these conventions:
  770.  
  771. (1)  Any characters (other than the delimiter) may be placed between
  772. the match and substitution strings. This allows various notations to
  773. symbolize the change. For example, the following are equivalent:
  774.  
  775.     \ch "thou" "you"
  776.     \ch "thou" to "you"
  777.     \ch "thou" > "you"
  778.     \ch "thou" --> "you"
  779.     \ch "thou" becomes "you"
  780.  
  781. (2)  Comments included after the substitution string are initiated by
  782. a semicolon (;), or whatever is indicated as the comment character by
  783. means of the -c option when KTEXT is started. The following lines
  784. illustrate the use of comments:
  785.  
  786.     \ch "qeki" "qiki" ; for cases like wawqeki
  787.     \ch "thou" "you"  ; for modern English
  788.  
  789. (3)  A change can be ignored temporarily by turning it into a comment
  790. field. This is done either by placing an unrecognized field code in
  791. front of the normal \ch, or by placing a semicolon (;) in front of it
  792. (the default comment character). For example, only the first of the
  793. following three lines would effect a change:
  794.  
  795.     \ch "nb" "mp"
  796.     \no \ch "np" "np"
  797.     ;\ch "mb" "nb"
  798.  
  799. KTEXT applies a change table as an ordered set of changes. The first
  800. change is applied to the entire word by searching from left to right
  801. for any matching strings and, upon finding any, replacing them with
  802. the substitution string. After the first change has been applied to
  803. the entire word, then the next change is applied, and so on. Thus,
  804. each change applies to the result of all prior changes. When all the
  805. changes have been applied, the resulting word is returned. For
  806. example, suppose we have the following changes:
  807.  
  808. \ch "aib" > "ayb"
  809. \ch "yb"  > "yp"
  810.  
  811. Consider the effect these have on the word paiba. The first changes i
  812. to y, yielding payba; the second changes b to p, to yield paypa. (This
  813. would be better than the single change of aib to ayp if there were
  814. sources of yb other than the output of the first rule.)
  815.  
  816. The way in which change tables are applied by KTEXT allows certain
  817. tricks. For example, suppose that for Quechua, we wish to change hw to
  818. f, so that hwista becomes fista and hwis becomes fis. However, we do
  819. not wish to change the sequence shw or chw to sf or cf (respectively).
  820. This could be done by the following sequence of changes. (Note, @ and
  821. $ are not otherwise used in the orthography.)
  822.  
  823. \ch "shw" > "@"     ; (1)
  824. \ch "chw" > "$"     ; (2)
  825. \ch "hw"  > "f"     ; (3)
  826. \ch "@"   > "shw"   ; (4)
  827. \ch "$"   > "chw"   ; (5)
  828.  
  829. Lines (1) and (2) protect the sh and ch by changing them to
  830. distinguished symbols. This clears the way for the change of hw to f
  831. in (3). Then lines (4) and (5) restore @ and $ to sh and ch,
  832. respectively. (An alternative, simpler way to do this is discussed in
  833. the next section.)
  834.  
  835. 7.1.2 Environmentally constrained changes
  836.  
  837. It is possible to impose string environment constraints (SEC's) on
  838. changes in the orthography change tables. The syntax of SEC's is
  839. described in detail in section 7.2.
  840.  
  841. For example, suppose we wish to change the mid vowels (e and o) to
  842. high vowels (i and u respectively) immediately before and after q.
  843. This could be done with the following changes:
  844.  
  845. \ch "o" "u"  / _ q  / q _
  846. \ch "e" "i"  / _ q  / q _
  847.  
  848. This is not entirely a hypothetical example; some Quechua practical
  849. orthographies write the mid vowels e and o. However, in the
  850. environment of /q/ these could be considered phonemically high vowels
  851. /i/ and /u/. Changing the mid vowels to high upon loading texts has
  852. the advantage that--for cases like upun `he drinks' and upoq `the one
  853. who drinks'--the root needs to be represented internally only as upu
  854. `drink'. But note, because of Spanish loans, it is not possible to
  855. change all cases of e to i and o to u. The changes must be
  856. conditioned.
  857.  
  858. In reality, the regressive vowel-lowering effect of /q/ can pass over
  859. various intervening consonants, including /y/, /w, /l/, /ll/, /r/,
  860. /m/, /n/, and /n/. For example, /ullq/ becomes ollq, /irq/ becomes
  861. erq, etc. Rather than list each of these cases as a separate
  862. constraint, it is convenient to define a class (which we label
  863. +resonant) and use this class to simplify the SEC. Note that the
  864. string class must be defined (with the \scl field code) before it is
  865. used in a constraint.
  866.  
  867. \scl +resonant y w l ll r m n n~
  868. \ch "o" "u" / q _ / _ ([+resonant]) q
  869. \ch "e" "i" / q _ / _ ([+resonant]) q
  870.  
  871. This says that the mid vowels become high vowels after /q/ and before
  872. /q/, possibly with an intervening /y/, /w/, /l/, /ll/, /r/, /m/, /n/,
  873. or /n/.
  874.  
  875. Consider the problem posed for Quechua in the previous section, that
  876. of changing hw to f. An alternative is to condition the change so that
  877. it does not apply adjacent to a member of the string class Affric
  878. which contains s and c. \scl Affric c s
  879.  
  880. \ch "hw" "f" / [Affric] ~_
  881.  
  882. It is sometimes convenient to make certain changes only at word
  883. boundaries, that is, to change a sequence of characters only if they
  884. initiate or terminate the word. This conditioning is easily expressed,
  885. as shown in the following examples.
  886.  
  887. \ch "this" "that"           ; anywhere in the word
  888. \ch "this" "that"  / # _    ; only if word initial
  889. \ch "this" "that"  /   _ #  ; only if word final
  890. \ch "this" "that"  / # _ #  ; only if entire word
  891.  
  892. 7.1.3  Using text orthography changes
  893.  
  894. The purpose of orthography change is to convert text from an external
  895. orthography to an internal representation more suitable for
  896. morphological analysis. In many cases this is unnecessary, the
  897. practical orthography being completely adequate as KTEXT's internal
  898. representation. In other cases, the practical orthography is an
  899. inconvenience that can be circumvented by converting to a more
  900. phonemic representation.
  901.  
  902. Let us take a simple example from Latin. In the Latin orthography, the
  903. nominative singular masculine of the word king is rex. However,
  904. phonemically, this is really /reks/; /rek/ is the root meaning king
  905. and the /s/ is an inflectional suffix. If KTEXT is to recover such an
  906. analysis, then it is necessary to convert the x of the external,
  907. practical orthography into ks internally. This can be done by
  908. including the following orthography change in the text input control
  909. file:
  910.  
  911. \ch  "x"  "ks"
  912.  
  913. In this, x is the match string and ks is the substitution string, as
  914. discussed in chapter 8. Whenever x is found, ks is substituted for it.
  915.  
  916. Let us consider next an example from Huallaga Quechua. The practical
  917. orthography currently represents long vowels by doubling the vowel.
  918. For example, what is written as kaa is /ka:/ 'I am', where the length
  919. (represented by a colon) is the morpheme meaning 'first person
  920. subject'. Other examples, such as upoo /upu:/ 'I drink' and upichee
  921. /upi-chi-:/ 'I extinguish', motivate us to convert all long vowels
  922. into a vowel followed by a colon. The following changes do this:
  923.  
  924. \ch  "aa"  "a:"
  925. \ch  "ee"  "i:"
  926. \ch  "ii"  "i:"
  927. \ch  "oo"  "u:"
  928. \ch  "uu"  "u:"
  929.  
  930. Note that the long high vowels (i and u) have become mid vowels (e and
  931. o respectively); consequently, the vowel in the substitution string is
  932. not necessarily the same as that of the match string. What is the
  933. utility of these changes? In the lexicon, the morphemes can be
  934. represented in their phonemic forms; they do not have to be
  935. represented in all their orthographic variants. For example, the first
  936. person subject morpheme can be represented simply as a colon (-:),
  937. rather than as -a in cases like kaa, as -o in cases like qoo, and as
  938. -e as in cases like upichee. Further, the verb 'drink' can be
  939. represented as upu and the causative suffix (in upichee) can be
  940. represented as -chi; these are the forms these morphemes have in other
  941. (nonlowered) environments. As the next example, let us suppose that we
  942. are analyzing Spanish, and that we wish to work internally with k
  943. rather than c (before a, o, and u) and qu (before i and e). (Of
  944. course, this is probably not the only change we would want to make.)
  945. Consider the following changes:
  946.  
  947. \ch  "ca"  "ka"
  948. \ch  "co"  "ko"
  949. \ch  "cu"  "ku"
  950. \ch  "qu"  "k"
  951.  
  952. The first three handle c and the last handles qu. By virtue of
  953. including the vowel after c, we avoid changing ch to kh. There are
  954. other ways to achieve the same effect. One way exploits the fact that
  955. each change is applied to the output of all previous changes. Thus, we
  956. could first protect ch by changing it to some distinguished character
  957. (say @), then changing c to k, and then restoring @ to ch:
  958.  
  959. \ch  "ch"  "@"
  960. \ch  "c"  "k"
  961. \ch  "@"  "ch"
  962. \ch  "qu"  "k"
  963.  
  964. Another approach conditions the change by the adjacent characters. The
  965. changes could be rewritten as
  966.  
  967. \ch  "c"  "k"  / _a  / _o  / _u  ; only before a, o, or u
  968. \ch  "qu"  "k"                   ; in all cases
  969.  
  970. The first change says, "change c to k when followed by a, o, or u."
  971. (This would, for example, change como to komo, but would not affect
  972. chal.) The syntax of such conditions is exactly that used in string
  973. environment constraints; see section 7.2.
  974.  
  975. 7.1.1 Where orthography changes apply
  976.  
  977. Orthography changes are made when the text being analyzed may be
  978. written in a practical orthography. Rather than requiring that it be
  979. converted as a prerequisite to morphological analysis, it is possible
  980. to have KTEXT convert the orthography as it loads and analyzes each
  981. word, before any analysis is performed.
  982.  
  983. The changes loaded from the text input control file are used in the
  984. module TXTIN, after all the text is converted to lower case (and the
  985. information about upper and lower case, along with information about
  986. format marking, punctuation and white space, has been put to one
  987. side.) Consequently, the match strings of these orthography changes
  988. should be all lower case; any change that has an uppercase character
  989. in the match string will never apply.
  990.  
  991. 7.1.2 A sample orthography change table
  992.  
  993. We include here the entire orthography input change table for Caquinte
  994. (Campa). There are basically four changes that need to be made: (1)
  995. nasals, which in the practical orthography reflect their assimilation
  996. to the point of articulation of a following noncontinuant, must be
  997. changed into an unspecified nasal, represented by N; (2) c and qu are
  998. changed to k; (3) j is changed to h; and (4) gu is changed to g before
  999. i and e.
  1000.  
  1001.              Figure 8  Caquinte orthography change table
  1002.  
  1003.             \ch  "mp"  "Np"     ; for unspecified nasals
  1004.             \ch  "nch" "Nch"
  1005.             \ch  "nc"  "Nk"
  1006.             \ch  "nqu" "Nk"
  1007.             \ch  "nt"  "Nt"
  1008.  
  1009.             \ch  "ch"  "@"   ; to protect ch
  1010.             \ch  "c"   "k"   ; other c's to k
  1011.             \ch  "@"   "ch"  ; to restore ch
  1012.             \ch  "qu"  "k"
  1013.  
  1014.             \ch  "j"   "h"
  1015.  
  1016.             \ch  "gue" "ge"
  1017.             \ch  "gui" "gi"
  1018.  
  1019. This change table can be simplified by the judicious use of string
  1020. environment constraints:
  1021.  
  1022.         Figure 9  Simplified Caquinte orthography change table
  1023.  
  1024.         \ch  "m"  >  "N"  / _p
  1025.         \ch  "n"  >  "N"  / _c  / _t  / _qu
  1026.  
  1027.         \ch  "c"  >  "k"  / _~h
  1028.         \ch  "qu" >  "k"
  1029.  
  1030.         \ch  "j"  >  "h"
  1031.  
  1032.         \ch  "gu" >  "g"  / _e  /_i
  1033.  
  1034. 7.1.3  Orthography change (code \ch)
  1035.  
  1036. As suggested by the preceding examples, the text orthography change
  1037. table is composed of all the \ch fields found in the text input
  1038. control file. These may appear anywhere in the file relative to the
  1039. other fields. It is recommended that all the orthography changes be
  1040. placed together in one section of the text input control file, rather
  1041. than being mixed in with other fields.
  1042.  
  1043. 7.1.4  String class definition (code \scl)
  1044.  
  1045. String classes are defined using the \scl field code. The members of
  1046. string classes are literal strings or single characters. Any number of
  1047. string classes may be defined, and any class may contain any number of
  1048. strings. These strings may be of any length, although they usually
  1049. represent phonological segments. String class names can be used in the
  1050. string environment constraints of following changes.
  1051.  
  1052. String classes must be defined before being used. For example, the
  1053. first two lines of the Caquinte example above could be given as
  1054. follows:
  1055.  
  1056. \scl  -bilabial  c t qu
  1057. \ch  "m"  >  "N"  / _ p
  1058. \ch  "n"  >  "N"  / _ [-bilabial]
  1059.  
  1060. The string class definition could be in the main control file: string
  1061. classes defined there can be used in the text input control file as
  1062. well.
  1063.  
  1064. 7.2 Words or format markers?
  1065.  
  1066. KTEXT may sometimes be applied to a pure text file, such as a
  1067. wordlist. Usually, however, there may be formatting information (i.e.,
  1068. punctuation and some sort of descriptive markup) mixed in with the
  1069. words. KTEXT needs to differentiate between the words and everything
  1070. else in the input text file. The fields discussed in this section
  1071. allow the user to inform KTEXT how to recognize words and how to
  1072. recognize formatting information.
  1073.  
  1074. 7.2.1 Word formation characters (codes \wfc and \luwfc)
  1075.  
  1076. To break a text into words, KTEXT needs to know which characters are
  1077. used to form words. It always assumes that the letters A to Z and a to
  1078. z will be used as word formation characters. (Note that uppercase
  1079. letters are converted to lowercase letters when KTEXT reads a text
  1080. file.) If the orthography of the language the user is working in uses
  1081. any other characters, these must given in a \wfc field in the text
  1082. input control file. For example, Quechua uses tilde (~) and an accent
  1083. mark ('). This information is provided by the following example:
  1084.  
  1085. \wfc  ~  ; needed for words like nin~o
  1086. \wfc  '  ; needed for words like papa'
  1087.  
  1088. Notice that the characters may be separated by spaces, although it is
  1089. not required to do so. If more than one \wfc field occurs in the text
  1090. input control file, KTEXT uses the combination of all characters
  1091. defined in all such fields as word formation characters.
  1092.  
  1093. The \wfc field is also used to declare accented (or eight bit)
  1094. characters, such as those available in the IBM extended character set.
  1095. For example,
  1096.  
  1097. \wfc  ç Ä Æ ù £ ê Å ô ÿ ¥ û ä
  1098.  
  1099. KTEXT automatically converts the upper case characters A-Z to their
  1100. equivalent lower case characters a-z. You can also declare other pairs
  1101. of characters as lower-to-upper case pairs. This is especially useful
  1102. when using accented characters (such as those available in the IBM
  1103. extended character set). Lower-to-upper case pairs are declared in a
  1104. field beginning with the code \luwfc (for "lower-upper word formation
  1105. characters"). For each following pair of  characters, the first
  1106. character is the lower case equivalent of the second (which is assumed
  1107. to  be upper case). Several such pairs can be placedin the field or
  1108. they may be placed in separate fields. Whitespace can be used in the
  1109. field freely. Characters that are declared in a \luwfc do not also
  1110. have to be included in a \wfc field. For example,
  1111.  
  1112. \luwfc  Ä â  ƒ å  û ä
  1113.  
  1114. After reading the text input control file, KTEXT reports the full set
  1115. of word formation characters being used. This is what KTEXT would
  1116. report for the Quechua example above:
  1117.  
  1118. Using the following as word-formation characters:
  1119. ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~'
  1120.  
  1121. The comment character (normally ;) cannot be designated as a word
  1122. formation character. If the orthography includes semicolon (;), then a
  1123. different comment character must be defined with the - c command line
  1124. option when KTEXT is initiated; see section 3.
  1125.  
  1126. 7.2.2 Primary format marker character (code \format)
  1127.  
  1128. KTEXT has a simple view of format markers: they consist of one or more
  1129. contiguous characters beginning with a special flag character. The
  1130. default character initiating format markers is the backslash (\).
  1131. Thus, each of the following would be recognized as a format marker and
  1132. would not be analyzed by KTEXT:
  1133.  
  1134. \
  1135. \p
  1136. \sp
  1137. \xx(yes)
  1138. \very-long.and;muddled/format*marker,to#be$sure
  1139.  
  1140. If \ is used in the orthography, or some other character is used to
  1141. flag format markers, it is possible to change to another format flag
  1142. character with a \format field in the text input control file. This
  1143. field designates a single character to replace the default \. For
  1144. example, if the format markers in the text files begin with the at
  1145. sign (@), the following should be placed in the text input control
  1146. file:
  1147.  
  1148. \format @   ; format markers start with at sign
  1149.  
  1150. This would be used, for example, if the text contained format markers
  1151. like the following:
  1152.  
  1153. @
  1154. @p
  1155. @sp
  1156. @xx(yes)
  1157. @very-long.and;muddled/format*marker,to#be$sure
  1158.  
  1159. Note that format markers cannot have a space or tab embedded in them;
  1160. the first space or tab encountered terminates the format marker as far
  1161. as KTEXT is concerned.
  1162.  
  1163. If a \format field occurs in the text input control file without a
  1164. following character to serve for flagging format markers, then KTEXT
  1165. will not recognize any format markers and will try to parse everything
  1166. other than punctuation characters.
  1167.  
  1168. It makes sense to use the \format field only once in the text input
  1169. control file. If multiple \format fields do occur in the file, KTEXT
  1170. uses only the value given in the first one. KTEXT uses only the first
  1171. printing character following the \format field code. The same
  1172. character cannot be used for flagging both format markers in text
  1173. input files and comments in control input files. Thus, semicolon (;)
  1174. cannot normally be used to flag format markers.
  1175.  
  1176. One final note: the format character under discussion here applies
  1177. only to the input text files which are to be analyzed. It has
  1178. absolutely nothing to do with the use of backslash (\) to flag field
  1179. codes in the control files read by KTEXT.
  1180.  
  1181. 7.2.3 Secondary format marker character (code \barchar)
  1182.  
  1183. In addition to the general format markers discussed above, KTEXT
  1184. assumes a secondary type of marker which has a very restricted form.
  1185. It consists of a flag character followed by a single character from a
  1186. list of known values. It is typically used to indicate type style,
  1187. such as bold, italics, and so on. This secondary flag character must
  1188. be different than the one associated with the \format field. Its
  1189. default value is the vertical bar (|), causing this type of format
  1190. marker to be frequently called a bar code. The following could be
  1191. valid (secondary) format markers and would not be analyzed by KTEXT:
  1192.  
  1193. |b
  1194. |i
  1195. |r
  1196.  
  1197. (These codes typically stand for bold, italics, and regular,
  1198. respectively.)
  1199.  
  1200. Consider the following two lines of input text:
  1201.  
  1202. \bgoodbye\r
  1203. |bgoodbye|r
  1204.  
  1205. Using the default definitions of KTEXT, the first line is considered
  1206. to be a single format marker, and provides nothing which the program
  1207. should try to parse. The second line, however contains two format
  1208. markers, |b and |r, and the word goodbye which will be analyzed by
  1209. KTEXT.
  1210.  
  1211. If | is used in the orthography, or some other character is used to
  1212. flag format markers, the flag character can be changed with a \barchar
  1213. field in the text input control file. This field designates a single
  1214. character to replace the default |. For example, if this type of
  1215. format marker begins with the dollar sign ($), the following should be
  1216. placed in the text input control file:
  1217.  
  1218. \barchar  $  ; "bar codes" start with $
  1219.  
  1220. This would cause KTEXT to consider the following to be valid format
  1221. markers:
  1222.  
  1223. $b
  1224. $i
  1225. $r
  1226.  
  1227. An empty \barchar field in the text input control file causes KTEXT to
  1228. not recognize any bar code format markers. Thus, the following field
  1229. effectively turns off special treatment of this style of format
  1230. marking:
  1231.  
  1232. \barchar  ; no bar character
  1233.  
  1234. It makes sense to use the \barchar field only once in the text input
  1235. control file. If multiple \barchar fields do occur in the file, KTEXT
  1236. uses only the value given in the first one. KTEXT uses only the first
  1237. printing character following the \barchar field code. The same
  1238. character cannot be used for marking both bar codes in the text file
  1239. and comments in the input control files. Thus, semicolon (;) cannot
  1240. normally be used as the bar code marker.
  1241.  
  1242. 7.2.4 Single character bar codes (code \barcodes)
  1243.  
  1244. In conjunction with the special format marking character discussed in
  1245. the previous section, the \barcodes field defines the individual
  1246. characters used with in bar codes. These characters may be separated
  1247. by spaces or lumped together. Thus, the following two fields are
  1248. equivalent:
  1249.  
  1250. \barcodes  abcdefg  ; lumped together
  1251. \barcodes  a b c d e f g  ; separated
  1252.  
  1253. If provided more than one \barcodes field in the text input control
  1254. file, KTEXT uses the combination of all characters defined in all such
  1255. fields. No check is made for repeated characters: the previous example
  1256. would be accepted without complaint despite the redundancy of the
  1257. second line.
  1258.  
  1259. The default value for the bar codes is bdefhijmrsuvyz. Therefore, if
  1260. the text input control file contains neither a \barchar nor a
  1261. \barcodes field, the following bar codes are considered to be
  1262. formatting information by KTEXT: |b, |d, |e, |f, |h, |i, |j, |m, |r,
  1263. |s, |u, |v, |y, and |z. These are exactly the codes recognized by the
  1264. SIL MS (Manuscripter) program.
  1265.  
  1266. 7.3 Selecting fields
  1267.  
  1268. There are times when it is undesirable for KTEXT to analyze every
  1269. field of a text input file. For instance, texts often begin with
  1270. identification lines to record authorship and state of revision. There
  1271. is no reason why this information should be morphologically parsed. It
  1272. may not even be in the same language!
  1273.  
  1274. KTEXT considers a field of an input text file to be everything from
  1275. one format marker to the next (or to the end of the file). This is
  1276. different than the definition of fields in the input control files,
  1277. which require field codes to be at the beginning of a line. Even
  1278. though it seems a bit strange to mix the concepts of fields and format
  1279. marking, this has proven to be useful in practice. (However, the
  1280. structure of a formatted text may not look that different from the
  1281. types of database files used by KTEXT, especially the text
  1282. approximates the style of descriptive markup. In the next two
  1283. sections, we will discuss two fields for controlling what parts of a
  1284. file KTEXT applies to. It does not make sense to include both of these
  1285. in the same text input control file. The one which best fits the task
  1286. at hand must be chosen.
  1287.  
  1288. 7.3.1 Fields to exclude (code \excl)
  1289.  
  1290. The \excl field excludes one or more fields from processing by KTEXT.
  1291. For example, to have KTEXT ignore everything in \co and \id fields,
  1292. the following line is included in the text input control file:
  1293.  
  1294. \excl  \co  \id  ; ignore these fields
  1295.  
  1296. If more than one \excl field is found in the text input control file,
  1297. KTEXT keeps adding the contents of each field to the overall list of
  1298. text fields to exclude. This list is initially empty, and stays empty
  1299. unless the text input control file contains an \excl field. Thus,
  1300. KTEXT normally does not exclude any text fields from processing.
  1301.  
  1302. If the text input control file contains \excl fields, then only those
  1303. text fields are not processed. Every word in every text field not
  1304. mentioned explicitly in an \excl field will be analyzed.
  1305.  
  1306. 7.3.2 Fields to include (code \incl)
  1307.  
  1308. The \incl field explicitly includes one or more text fields for
  1309. processing by KTEXT, excluding all other fields. For instance, to have
  1310. KTEXT process everything in \txt and \qt fields, but ignore everything
  1311. else, the following line is placed in the text input control file:
  1312.  
  1313. \incl  \txt  \qt  ; process these fields
  1314.  
  1315. If more than one \incl field is found in the text input control file,
  1316. KTEXT keeps adding the contents of each field to the overall list of
  1317. text fields to process. This list is initially empty, and stays empty
  1318. unless the text input control file contains an \incl field.
  1319.  
  1320. If the text input control file contains \incl fields, then only those
  1321. text fields are processed. Every word in every text field not
  1322. mentioned explicitly in an \incl field will not be analyzed. Note that
  1323. KTEXT processes every text field in the text input files unless the
  1324. text input control file contains either an \excl or an \incl field.
  1325. One or the other is used to limit processing, but never both.
  1326.  
  1327. 7.4 Special output characters
  1328.  
  1329. The last two fields provided in the text input control file change
  1330. certain special characters in the analysis output file. This may be
  1331. required by the orthography of the language to which KTEXT is being
  1332. applied.
  1333.  
  1334. 7.4.1 Ambiguity marker (code \ambig)
  1335.  
  1336. The morphological analysis performed by KTEXT may result in multiple
  1337. parses, an ambiguity which the computer program cannot resolve. It is
  1338. also possible for KTEXT to fail altogether in trying to analyze a
  1339. word. These two possibilities are normally shown in the analysis
  1340. output file as follows:
  1341.  
  1342. \a  %3%< N0 kay >%< V1 ka > IMP%< V1 ka > INF%
  1343.  
  1344. \a  %0%qoyka:rala:may%
  1345.  
  1346. This works fine unless the percent sign (%) is used in the
  1347. orthography.
  1348.  
  1349. The \ambig field controls the character used to mark ambiguities and
  1350. failures in the analysis output file. For example, to use the hash
  1351. mark (#), the text input control file should include:
  1352.  
  1353. \ambig #  ; % isn't good enough
  1354.  
  1355. This would cause the sample analysis to be output as follows:
  1356.  
  1357. \a  #3#< N0 kay >#< V1 ka > IMP#< V1 ka > INF#
  1358.  
  1359. \a  #0#qoyka:rala:may#
  1360.  
  1361. It makes sense to use the \ambig field only once in the text input
  1362. control file. If multiple \ambig fields do occur in the file, KTEXT
  1363. uses only the value given in the first one. If the text input control
  1364. file does not have an \ambig field, KTEXT uses the %.
  1365.  
  1366. KTEXT uses only the first printing character following the \ambig
  1367. field code. The same character cannot be used for marking both
  1368. ambiguities in the analysis output file and comments in the input
  1369. control files. Thus, semicolon (;) cannot normally be used as the
  1370. ambiguity marker.
  1371.  
  1372. 7.4.2 Morpheme decomposition separator (code \dsc)
  1373.  
  1374. When KTEXT asks whether to include the morpheme decomposition field in
  1375. the output, if the user responds positively, it produces results like
  1376. the following:
  1377.  
  1378. \a  < V2 *qu > IN PLDIR POL 1O IMP
  1379. \d  qo-yka-:ra-lla:-ma-y
  1380.  
  1381. \a  %3%< N0 kay >%< V1 ka > IMP%< V1 ka > INF%
  1382. \d  %3%kay%ka-y%ka-y%
  1383.  
  1384. Note that the allomorph strings in the decomposition (\d) field are
  1385. separated by dashes (-). This works fine unless the language uses the
  1386. dash in its orthography.
  1387.  
  1388. The \dsc field controls the character used to separate the morphemes
  1389. in the decomposition field. For example, one might use the equal sign
  1390. (=) by including the following in the text input control file:
  1391.  
  1392. \dsc  =  ; - is used by the orthography
  1393.  
  1394. This would cause the sample analysis to be output as follows:
  1395.  
  1396. \a  < V2 *qu > IN PLDIR POL 1O IMP
  1397. \d  qo=yka=:ra=lla:=ma=y
  1398.  
  1399. \a  %3%< N0 kay >%< V1 ka > IMP%< V1 ka > INF%
  1400. \d  %3%kay%ka=y%ka=y%
  1401.  
  1402. It makes sense to use the \dsc field only once in the text input
  1403. control file. If multiple \dsc fields do occur in the file, KTEXT uses
  1404. the value given in the first one. If the text input control file does
  1405. not have an \dsc field, KTEXT uses a dash (-). KTEXT uses only the
  1406. first printing character following the \dsc field code. The same
  1407. character cannot be used both for separating decomposed morphemes in
  1408. the analysis output file and for marking comments in the input control
  1409. files. Thus, one normally cannot use semicolon (;) as the
  1410. decomposition separation character.
  1411.  
  1412. 7.5 Controlling capitalization
  1413.  
  1414. KTEXT records the capitalization pattern of each word in the text
  1415. file. Besides the typical case of a word whose initial letter is
  1416. capitalized (because it is a proper noun or because it is the first
  1417. word in a sentence), there are two special cases: words with mixed
  1418. capitals and words in all capitals. First, for words with mixed
  1419. capitals (such as MacDonald), the capitalization of each letter is
  1420. recorded through the first thirteen letters of the word (this
  1421. limitation is due to the length of the bit field used to record
  1422. capitalization information). Second, words in all capitals are
  1423. specially marked as such and capitalization is recorded no matter how
  1424. long the word is.
  1425.  
  1426. Word-internal capitalization can be disabled by using the \noincap
  1427. option in the input text control file. This feature will likely only
  1428. be of use if you intend to translate KTEXT's output into another
  1429. language and you know that the internal recapitalization is likely to
  1430. be wrong.
  1431.  
  1432. 7.6 A sample text input control file
  1433.  
  1434. The following is the complete text input control file for Huallaga
  1435. Quechua:
  1436.  
  1437. \id HGTEXT.CTL - for Huallaga Quechua, 25-May-88
  1438.  
  1439. \co         WORD FORMATION CHARACTERS
  1440.  
  1441. \wfc  ' ~
  1442.  
  1443. \co         FIELDS TO EXCLUDE
  1444.  
  1445. \excl  \id            ; identification fields
  1446.  
  1447. \co         ORTHOGRAPHY CHANGES
  1448.  
  1449. \ch  "aa" > "a:"      ; for long vowels
  1450. \ch  "ee" > "i:"
  1451. \ch  "ii" > "i:"
  1452. \ch  "oo" > "u:"
  1453. \ch  "uu" > "u:"
  1454. \ch  "qeki" > "qiki"  ; for cases like wawqeki
  1455. \ch  "~n" > "n~"      ; for typos
  1456.                       ; for Spanish loans like hwista
  1457. \scl sib s c          ; sibilants
  1458. \ch  "hw" > "f"  / ~[sib]_
  1459.  
  1460. 8    The output data file
  1461.  
  1462. KTEXT formats its output as a database, each record of which
  1463. corresponds to a word of the source text. The first field of each
  1464. entry contains the analysis, the second field the morpheme
  1465. decomposition, and the third field (which is optional, see section 3
  1466. on using the -w option) the original word. Other fields, which may or
  1467. may not occur in any given entry, contain information about the
  1468. capitalization of the word, format marking, punctuation, and white
  1469. space. The fields and their field codes are as shown in figure 10:
  1470.  
  1471.            Figure 10  Field codes produced in the analysis
  1472.  
  1473.            Code            Description
  1474.            -------         ----------------
  1475.            \a              analysis
  1476.            \d              morpheme decomposition
  1477.            \w              original word
  1478.            \f              preceding format marks
  1479.            \c              capitalization
  1480.            \n              trailing nonalphabetics
  1481.  
  1482. For example, suppose that itçtanim (from a Tagalog input text)
  1483. analyzes unambiguously, and that the original word and the morpheme
  1484. decomposition are both requested. The resulting analysis file contains
  1485. the following lines:
  1486.  
  1487. \a IP DUR < V plant >
  1488. \d i-RE-tanôm
  1489. \w itçtanim
  1490.  
  1491. For some words, KTEXT discovers more than one possible analysis. We
  1492. call these ambiguities (or multiple parses). In this case, KTEXT puts
  1493. all the alternatives into the resulting analysis file separated by a
  1494. percent sign (%), and with a number to indicate how many there are.
  1495. For example, Quechua kay is a three-fold ambiguity:
  1496.  
  1497. \a    %3%< N0 kay >%< V1 ka > IMP%< V1 ka > INF%
  1498. \d    %3%kay%ka-y%ka-y%
  1499. \w    kay
  1500.  
  1501. KTEXT may fail to analyze a word from the input text. Analysis
  1502. failures appear in the resulting analysis file surrounded by percent
  1503. signs and preceded by the number zero (0), as the following
  1504. illustrates:
  1505.  
  1506. \a    %0%qoyka:rala:may%
  1507. \d    %0%qoyka:rala:may%
  1508. \w    qoykaaralaamay
  1509.  
  1510. If you use a log file (see section 3), it will record all instances of
  1511. analysis failures. To edit failures and ambiguities in the output
  1512. file, you can use a special editor called CED, which is described in
  1513. section 9.
  1514.  
  1515. As has been noted elsewhere, KTEXT has much in common with the program
  1516. AMPLE, whose text-processing routines KTEXT has borrowed. In order to
  1517. be able to use other software that expects AMPLE-style output, it is
  1518. desireable to understand how to reproduce it with KTEXT. There are
  1519. some features of KTEXT's output file that you cannot change, notably
  1520. the field code names and their order in a record. Indeed, to remain
  1521. compatible with AMPLE they should not be changed. But the actual
  1522. contents of the fields themselves depend entirely on the format of the
  1523. PC- KIMMO lexicon file and consistent changes speciified in the
  1524. control files. For example, here is a record from the output file
  1525. produced by the English example (supplied with KTEXT):
  1526.  
  1527. \a V(be`gin)+PROG
  1528. \d be`gin+ing
  1529. \w beginning
  1530.  
  1531. And here is a record from the output file produced by the Tagalog
  1532. example (supplied with KTEXT):
  1533.  
  1534. \a IP DUR < V plant >
  1535. \d i-RE-tanôm
  1536. \w itçtanim
  1537.  
  1538. The Tagalog example conforms to AMPLE while the English example does
  1539. not. The salient features of AMPLE output are as follows.
  1540.  
  1541. (1)  AMPLE requires every word to minimally contain a root. Even
  1542. particles that cannot take affixes are treated like roots.
  1543.  
  1544. (2)  In the \a field of a word record, the root of a word is delimited
  1545. by angled brackets (<>). In the Tagalog example above, the root of the
  1546. word is < V plant >. Notice that the left bracket is followed by a
  1547. space and the right bracket is preceded by a space.
  1548.  
  1549. (3)  Inside the angled brackets that delimit a root, there are exactly
  1550. two pieces of data: a word class (part of speech) abbreviation and a
  1551. gloss (or some other representation of the root, such as an underlying
  1552. form or protoform).
  1553.  
  1554. (4)  Morpheme boundary symbols (such as hyphen) are not used in the \a
  1555. field. Prefix and suffix glosses are separated from each other and the
  1556. root gloss by spaces.
  1557.  
  1558. (5)  In the \d field, only one morpheme boundary symbol is recognized;
  1559. by default it is hyphen (-), but this can be changed with the \dsc
  1560. field in the input text control file (see section 7.4.2).
  1561.  
  1562. There are two places where you can tweak KTEXT in order to make it
  1563. conform to these specifications: the lexicon file and the main control
  1564. file. The easiest way to get angled brackets around roots is simply to
  1565. include them in the glosses of all roots in the lexicon. (To be
  1566. absolutely safe, the brackets should be padded by one space.) For
  1567. example, here is the lexical entry for the Tagalog verb root tanim:
  1568.  
  1569. tanôm                 V_Root          "< V plant >"
  1570.  
  1571. Inside the angled brackets of the root gloss are the word class
  1572. abbreviation V and the gloss 'plant'.
  1573.  
  1574. In a typical PC-KIMMO lexicon file, the glosses of affixes normally
  1575. contain a morpheme boundary symbol; for example:
  1576.  
  1577. pag-                  V_Prefix        "VR1-"
  1578.  
  1579. where the - in the gloss VR1- indicates that it is a prefix. Such
  1580. glosses will incorrectly leave morpheme boundary symbols in the \a
  1581. field of the output word record. There are two ways to remove morpheme
  1582. boundary symbols from the \a field. First, replace them with spaces in
  1583. the lexicon file; for example:
  1584.  
  1585. pag-                  V_Prefix        "VR1 "
  1586.  
  1587. Second, leave them in the lexicon file but use a \ach field in the
  1588. main control file to change them to spaces; for example:
  1589.  
  1590. \ach  "-"  " "
  1591.  
  1592. Your lexicon file may use more than one morpheme boundary symbol. For
  1593. example, the Tagalog example uses hyphen for prefixes and plus sign
  1594. for suffixes (the phonological rules require this distinction). But
  1595. the \d field will only recognize one boundary symbol. This can be
  1596. fixed by including a \dch field in the main control file that changes
  1597. plus sign to hyphen:
  1598.  
  1599. \dch  "+"  "-"
  1600.  
  1601. See the Tagalog lexicon file and mail control file for more examples
  1602. of changes such as these.
  1603.  
  1604.  
  1605. 9  CED: an editor for failures and ambiguities[8]
  1606.  
  1607.   9.1  Overview of CED
  1608.   9.2  Starting the CED editor
  1609.        9.2.1  Giving CED an input file with the -i option
  1610.        9.2.2  Giving CED an output file with the -o option
  1611.        9.2.3  Changing CED's ambiguity marker with the -a option
  1612.   9.3  Editing for text glossing
  1613.   9.4  The editing process
  1614.   9.5  Command summary
  1615.        9.5.1  Major commands
  1616.        9.5.2  Word-edit commands
  1617.  
  1618. 9.1  Overview of CED
  1619.  
  1620. Sometimes KTEXT fails to analyze a word into morphemes. Such words are
  1621. referred to as failures, and are flagged as such in the output. For
  1622. example, tatanpa is flagged as a failure in the following:
  1623.  
  1624. \a %0%tatanpa%
  1625.  
  1626. In other cases, KTEXT produces multiple analyses for a given word.
  1627. Such cases are referred to as ambiguities, and are flagged as such in
  1628. the output. For example, the Quechua word aywamunchu produces the
  1629. following output, indicating two possibilities:
  1630.  
  1631. \a %2%< V1 *aywa > AFAR 3 NEG%< V1 *aywa > AFAR 3 YN?%
  1632.  
  1633. Each failure or ambiguity begins with a percent sign (%) followed by
  1634. an integer. This integer represents the number of analyses: 0 (zero)
  1635. for a failure, 2 if there are two alternatives of an ambiguous word, 3
  1636. if there are three alternatives, etc. Each alternative is terminated
  1637. by a percent sign.
  1638.  
  1639. If a complete and unambiguous morphological analysis of a text is
  1640. needed, as would be the case for text glossing, then the analysis
  1641. produced by KTEXT should be edited to deal with the failures and the
  1642. ambiguities. CED  is an editing program designed specifically for
  1643. dealing with only the flagged failures and ambiguities. (CED stands
  1644. for CADA Editor, CADA being an acronym for Computer Assisted Dialect
  1645. Adaptation.)  CED has various virtues:
  1646.  
  1647. (1)  It protects the user from unwanted changes. It allows
  1648. modification only of failures and ambiguities. Thus, CED is good for
  1649. users who are not familiar with a more general editing program, with
  1650. formatting conventions, etc. If needed, subsequent changes can be made
  1651. with a general-purpose editor.
  1652.  
  1653. (2)  It is easy to learn. Anyone should be able to use CED with 20
  1654. minutes of orientation.
  1655.  
  1656. (3)  It is safe for situations where electricity is unstable. It works
  1657. as a single pass (from the beginning to the end of the file), writing
  1658. the output as editing is done. To learn CED, skim the remainder of
  1659. this chapter and then try the program. Don't be dismayed if you have
  1660. trouble visualizing everything described here; you can always come
  1661. back and read this after giving CED a try.
  1662.  
  1663. 9.2  Starting the CED editor
  1664.  
  1665. CED is run by typing its name in response to the system prompt. After
  1666. it loads, it prompts for an input file. Suppose that you respond with
  1667. the filename xxxxxx.ana (followed, of course, by pressing the ENTER
  1668. key), and that CED finds the file. (If it does not find it, CED
  1669. requests the filename again.)  After finding the input file, CED asks
  1670. for the name of an output file, proposing that it be named xxxxxx.CED
  1671. (where xxxxxx is from the input filename). If you wish some other name
  1672. (e.g., to write the output somewhere other than on the default
  1673. device), you may type the filename after that prompt. If you are
  1674. satisfied with CED's suggestion, simply respond by pressing the ENTER
  1675. key. (Note that the ENTER key may be labeled RETURN on some
  1676. keyboards.)
  1677.  
  1678. Rather than wait for CED's prompting, you can designate either the
  1679. input file or the output file (or both) in the command used to start
  1680. CED. You can also designate a different ambiguity marker character to
  1681. match the one given by an \ambig field in the text input control file.
  1682. A command using all of these options would look like the following
  1683. (user input is underlined):
  1684.  
  1685. C> ced -i infile.ana -o outfil.ced -a @
  1686.  
  1687. Each of these command line options is discussed below.
  1688.  
  1689. 9.2.1  Giving CED an input file with the -i option
  1690.  
  1691. The name of the input file can be given as part of the command,
  1692. following the -i option. If CED is given an input file in this way, it
  1693. does not request an input filename. For example, the following two
  1694. interactions are equivalent in starting CED (user input is
  1695. underlined):
  1696.  
  1697. C> ced
  1698. CED (CADA Editor) version 2.0 (October 1988)
  1699. File to be edited: mytext.ana
  1700.  
  1701. or
  1702.  
  1703. C> ced -i mytext.ana
  1704. CED (CADA Editor) version 2.0 (October 1988)
  1705.  
  1706. 9.2.2  Giving CED an output file with the -o option
  1707.  
  1708. The name of the output file can be given as part of the command,
  1709. following the -o option. If CED is given an input file in this way, it
  1710. does not request an output filename. For example, the following two
  1711. interactions are equivalent in starting CED (user input is
  1712. underlined):
  1713.  
  1714. C> ced
  1715. CED (CADA Editor) version 2.0 (October 1988)
  1716. File to be edited: mytext.ana
  1717. Name of output file: [mytext.ced] mytext.out
  1718.  
  1719. or
  1720.  
  1721. C> ced -o mytext.out
  1722. CED (CADA Editor) version 2.0 (October 1988)
  1723. File to be edited: mytext.ana
  1724.  
  1725. If an output file is not given with the -o option, CED proposes a name
  1726. based on the input filename, but asks for confirmation. If you want to
  1727. use the output filename shown enclosed in brackets, simply respond to
  1728. the prompt by pressing the ENTER key.
  1729.  
  1730. 9.2.3  Changing CED's ambiguity marker with the -a option
  1731.  
  1732. KTEXT ordinarily flags failures and ambiguities in its output with a
  1733. percent sign (%):
  1734.  
  1735. \a %0%tatanpa%
  1736. \a %2%< V1 *aywa > AFAR 3 NEG%< V1 *aywa > AFAR 3 YN?%
  1737.  
  1738. However, this character can be changed, for example to the at sign
  1739. (@), by putting the following line in the text input control file:
  1740.  
  1741. \ambig  @
  1742.  
  1743. In this case, output would look like the following:
  1744.  
  1745. \a @0@tatanpa@
  1746. \a @2@< V1 *aywa > AFAR 3 NEG@< V1 *aywa > AFAR 3 YN?@
  1747.  
  1748. If CED were to be run on such an analysis without informing it that
  1749. the flagging character is different, it would fail to recognize the
  1750. failures and ambiguities.
  1751.  
  1752. To cause CED to recognize a different flagging character, we must
  1753. include the -a option, followed by the new flagging character, when
  1754. the program is started. For example, to edit a text in which failures
  1755. and ambiguities are flagged with @, CED would be initiated as follows
  1756. (user input is underlined):
  1757.  
  1758. C> ced -a @
  1759.  
  1760. The -a option is compatible with the other command line options (-i
  1761. and -o), and may either precede or follow them.
  1762.  
  1763. In the examples given below, we will use % as the flagging character,
  1764. since it is the default.
  1765.  
  1766. 9.3  Editing for text glossing
  1767.  
  1768. An analysis file used for text glossing should include morpheme
  1769. decomposition fields. Thus, every word has a pair of lines, one the
  1770. analysis, the other the decomposition. If the analysis failed, the \a
  1771. field contains the original word, and you must replace it with the
  1772. correct analysis. Further, the \d field also contains the original
  1773. word, and you must introduce hyphens (or some other separation
  1774. character) between the morphemes.
  1775.  
  1776. An analysis ambiguity looks like the following, where each analysis is
  1777. paired with the corresponding decomposition:
  1778.  
  1779. \a %2%< N0 thief > GOAL%< V2 steal > 1O 3%
  1780. \d %2%suwa-man%suwa-ma-n%
  1781.  
  1782. (Note that suwa-man corresponds to < N0 thief > GOAL, and suwa-ma-n to
  1783. < V2 steal > 1O 3.)  For each analysis, there is a decomposition, so
  1784. when you choose a particular analysis, CED automatically chooses the
  1785. corresponding decomposition. This greatly simplifies the task of
  1786. editing ambiguities.
  1787.  
  1788. 9.4  The editing process
  1789.  
  1790. CED splits the screen into two windows. Text is displayed in the upper
  1791. window, with a failure or ambiguity highlighted. Among the
  1792. alternatives of an ambiguity, the current alternative is given special
  1793. highlighting to distinguish it from the others. The flagging (%) does
  1794. not appear in the display of the site being edited. The lower window
  1795. contains the item to be edited, either a failure or the analysis
  1796. selected from the alternatives of an ambiguity. Prompts and helps are
  1797. also displayed in the bottom window.
  1798.  
  1799. To edit an ambiguity, you select, delete, or modify the current
  1800. alternative (the one that is highlighted). To select the current
  1801. alternative, press the ENTER key (which may be labeled RETURN instead
  1802. of ENTER), whereupon the other alternatives are discarded and the
  1803. selected analysis appears in the lower part of the screen. The cursor
  1804. appears after the last character. You may now modify the word, using
  1805. the word-edit commands.
  1806.  
  1807. When you are finished editing the word, press the ENTER key. CED then
  1808. asks "Is this what you want?" You may approve it by pressing the ENTER
  1809. key again. If, on the other hand, you wish to go back and make more
  1810. changes, type n and then press the ENTER key. At this point all of the
  1811. commands are available. For instance, if you would like to restore
  1812. this edit site to its original form (with all the original
  1813. alternatives) you may undo all modifications by typing u.
  1814.  
  1815. Whenever only one alternative remains (whether this has been brought
  1816. about by a selection or a series of deletions) the remaining
  1817. alternative is displayed on the lower portion of the screen for
  1818. editing and verification. Because failures have only one alternative,
  1819. whenever CED encounters one, it is automatically displayed in the
  1820. lower portion of the screen, whereupon you may modify it. There are
  1821. two cases in which you could be finished at an edit site:
  1822.  
  1823. (1)  You may wish to leave things as they are, to be corrected later;
  1824. you indicate this by typing c (continue).
  1825.  
  1826. If the cursor is in the lower window, you must first press the ENTER
  1827. key. When CED asks  "Is this what you want?", type n and then press
  1828. the ENTER key. Then you may give the c (continue) command to CED leave
  1829. this edit as it is.
  1830.  
  1831. (2)  You may be satisfied with the word as edited (of course you don't
  1832. have to change anything) so you press the ENTER key twice, once to
  1833. stop editing and once to verify that you are satisfied. In both cases
  1834. the text is then updated to reflect any changes you have made. CED
  1835. then moves on to the next site. CED removes the markers at an edit
  1836. site whenever you (by various manipulations) arrive at the word you
  1837. want and subsequently verify it. If you defer a decision concerning
  1838. how a site should be modified, the markers are not removed so that you
  1839. can edit these sites again with CED.
  1840.  
  1841. If you are unable to finish editing a text, you can direct CED to pass
  1842. the remainder of the input unchanged to the output file by typing q
  1843. (quit). (If the cursor is in the lower window, you must first press
  1844. the ENTER key and then respond with n to the query "Is this what you
  1845. want?" to get the full list of command options.)  This does not undo
  1846. any edits you have made previously. Subsequently, you may continue
  1847. from where you left off by again editing the modified text with CED.
  1848. In this case, the name of your input file probably ends with CED, and
  1849. CED will suggest exactly the same name for the output. If you accept
  1850. this (making the name of the output and input files identical) CED
  1851. will complain and ask for another output file. So do one of two
  1852. things: (1) rename the input file to something like xxxxxx.tem before
  1853. you starting CED, or (2) when CED asks for the name of the output file
  1854. (suggesting xxxxxx.ced) type a different name.
  1855.  
  1856. 9.5  Command summary
  1857.  
  1858. CED has two levels of command, major commands and word-edit commands.
  1859. The major commands involve actions at the level of an entire edit site
  1860. or of the file, whereas word-edit commands involve modifications to
  1861. particular word, carried out in the lower window. We now describe the
  1862. commands available at these two levels.
  1863.  
  1864. 9.5.1  Major commands
  1865.  
  1866. The major commands are single letters. CED does not wait for ENTER key
  1867. to be pressed before processing a command; indeed, the ENTER key is a
  1868. specific command. The commands are as follows:
  1869.  
  1870. (1)  c (continue) leaves this set of alternatives as they are and goes
  1871. on to the next edit site.
  1872.  
  1873. (2)  d deletes the current alternative.
  1874.  
  1875. (3)  e edits (i.e., allows modification to) the current alternative;
  1876. the word-edit commands listed below (in section 9.5.2) become
  1877. available.
  1878.  
  1879. (4)  q quits, that is, terminates this edit session. All modifications
  1880. previously made are retained in the output file. All subsequent
  1881. editing sites are passed to the output unmodified (to be dealt with in
  1882. a later editing session).
  1883.  
  1884. (5)  u undoes any modifications made at this site, that is, it
  1885. restores the edit site to the form it had in the input file.
  1886.  
  1887. (6)  ? or h displays a help message describing each of these commands
  1888. in the bottom window. If the window is too small to display the entire
  1889. message, CED pauses after filling the window and waits for the ENTER
  1890. key to be pressed before displaying more of the help message.
  1891.  
  1892. (7)  ENTER selects the current alternative, deleting all others and
  1893. putting the current alternative into the edit window. (This is the
  1894. single key labeled ENTER or RETURN, not the string E n t e r!)  After
  1895. any modifications and your approval, this alternative is put into the
  1896. output text and the other alternatives are discarded.
  1897.  
  1898. (8)  Space moves to the next alternative, making it the current
  1899. alternative. (This is the space bar, not the string S p a c e!)  When
  1900. at the last alternative, a space makes the first alternative into the
  1901. current one. Any character which is not recognized as a command serves
  1902. the same function.
  1903.  
  1904. 9.5.2  Word-edit commands
  1905.  
  1906. The word-edit commands are described in the following list. (CTRL/X
  1907. refers to the character generated by holding the CTRL key down while
  1908. simultaneously typing x.)
  1909.  
  1910. (1)  <- (the left arrow key) and CTRL/B move the cursor one character
  1911. to the left. If the cursor is on the first character, it moves to the
  1912. end of the word.
  1913.  
  1914. (2)  -> (the right arrow key) and CTRL/F move the cursor one character
  1915. to the right. If the cursor is at the end of the word, it moves to the
  1916. first character of the word.
  1917.  
  1918. (3)  DELETE, BACKSPACE, and CTRL/H delete the character to the left of
  1919. the cursor.
  1920.  
  1921. (4)  CTRL/U and CTRL/W delete the entire word being edited, allowing a
  1922. completely new word to be entered.
  1923.  
  1924. (5)  CTRL/R restores the original word, undoing any editing changes
  1925. which you have made.
  1926.  
  1927. (6)  ? displays a message in the bottom window describing each of
  1928. these word-edit commands. If the window is too small to display the
  1929. entire message, CED pauses after filling the window and waits for the
  1930. ENTER key to be pressed before displaying more of the message.
  1931.  
  1932. (7)  ENTER puts the word as it now appears into the output text
  1933. (provided you subsequently verify that this is what you want).
  1934.  
  1935. (8)  Any other character is inserted to the left of the cursor.
  1936.  
  1937.  
  1938. NOTES
  1939.  
  1940. 1  The particular choice of field markers and the order of fields in a
  1941. record is due to the fact that KTEXT uses the same text-handling
  1942. routines as an existing program called AMPLE (Weber et al., 1988).
  1943. This has the advantage that KTEXT's output is compatible with that
  1944. program, but the disadvantage that the record structure is perhaps not
  1945. consistent with terminology already established for PC-KIMMO. It
  1946. should also be noted that the quasi-database design of KTEXT 's output
  1947. is used by many other programs developed by the Summer Institute of
  1948. Linguistics.
  1949.  
  1950. 2  Tagalog, also known now as Pilipino or Filipino, is a major
  1951. language of the Philippines.
  1952.  
  1953. 3  IT (pronounced "eye-tee") is an interlinear text editor that
  1954. maintains the vertical alignment of the interlinear lines of text and
  1955. uses a lexicon to semi-automatically gloss the text. See Simons and
  1956. Versaw (1991) and Simons and Thomson (1988).
  1957.  
  1958. 4  ITF was developed by the Academic Computing Department of the
  1959. Summer Institute of Linguistics. It runs under MS-DOS, UNIX, and the
  1960. Apple Macintosh.
  1961.  
  1962. 5  TEX  is a typesetting language developed by Donald Knuth (see
  1963. Knuth, 1986).
  1964.  
  1965. 6  The plain text version of this documentation does not include
  1966. figure 4, since it is an image of typeset output.
  1967.  
  1968. 7  This section is adapted from chapters 7, 8, and 9 of Weber et al.
  1969. 1988.
  1970.  
  1971. 8  The CED program is not available for Macintosh.
  1972.  
  1973.  
  1974. REFERENCES
  1975.  
  1976. Antworth, Evan L. 1990. PC-KIMMO: a two-level processor for 
  1977.    morphological analysis. Occasional Publications in Academic 
  1978.    Computing No. 16. Dallas, TX: Summer Institute of Linguistics.
  1979.  
  1980. Bloomfield, Leonard. 1917. Tagalog texts with grammatical 
  1981.    analysis. Urbana, IL: University of Illinois.
  1982.  
  1983. Kew, Jonathan and Stephen R. McConnel. 1991. Formatting 
  1984.    interlinear text. Occasional Publications in Academic Computing 
  1985.    No. 17. Dallas, TX: Summer Institute of Linguistics.
  1986.  
  1987. Knuth, Donald E. 1986. The TEXbook. Reading, MA: Addison Wesley 
  1988.    Publishing Company.
  1989.  
  1990. Simons, Gary F., and John Thomson. 1988. How to use IT: 
  1991.    interlinear text processing on the Macintosh. Edmonds, WA: 
  1992.    Linguist's Software.
  1993.  
  1994. Simons, Gary F., and Larry Versaw. 1991. How to use IT: a guide to 
  1995.    interlinear text processing, 3rd ed. Dallas, TX: Summer 
  1996.    Institute of Linguistics.
  1997.  
  1998. Weber, David J., H. Andrew Black, and Stephen R. McConnel. 1988. 
  1999.    AMPLE: a tool for exploring morphology. Occasional Publications 
  2000.    in Academic Computing No. 12. Dallas, TX: Summer Institute of 
  2001.    Linguistics.
  2002.